﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="Message_List" MasterPageFile="~/MasterPage.master"
    EnableEventValidation="false" CodeFile="Message_List.aspx.cs" %>
    <%@ Register Src="~/UserControl/GridPager.ascx" TagName="GridPager"  TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title>消息查询</title>
    <style type="text/css">
        .style1
        {
            width: 91px;
            text-align:right;
        }
        .style2
        {
            width: 91px;
        }
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
 <script type="text/javascript">
            /*  
            将Date/String类型,解析为String类型.  
            传入String类型,则先解析为Date类型  
            不正确的Date,返回 ''  
            如果时间部分为0,则忽略,只返回日期部分.  
            */
            function formatDate(v) {
                if (v instanceof Date) {
                    var y = v.getFullYear();
                    var m = v.getMonth() + 1;
                    var d = v.getDate();
                    var h = v.getHours();
                    var i = v.getMinutes();
                    var s = v.getSeconds();
                    var ms = v.getMilliseconds();
                    if (ms > 0)
                        return y + '-' + m + '-' + d + ' ' + h + ':' + i + ':' + s
						+ '.' + ms;
                    if (h > 0 || i > 0 || s > 0)
                        return y + '-' + m + '-' + d + ' ' + h + ':' + i + ':' + s;
                    return y + '-' + m + '-' + d;
                }
                return '';
            }

            $(function () {
                $('#<%=txtStart.ClientID %>').datebox({
                    currentText: '今天',
                    closeText: '关闭',
                    disabled: false,
                    required: true,
                    missingMessage: '必填',
                    formatter: formatDate
                });
            });
            $(function () {
                $('#<%=txtEnd.ClientID %>').datebox({
                    currentText: '今天',
                    closeText: '关闭',
                    disabled: false,
                    required: true,
                    missingMessage: '必填',
                    formatter: formatDate
                });
            });
            </Script>
    <div>
         
        <table id="wsd_inputtable">
            <tr>
                <td class="tabletitle" colspan="6">
                    搜索选项
                </td>
            </tr>
            <tr>
                <td nowrap="nowrap" style="text-align:right">
                    关键字:
                </td>
                <td nowrap="nowrap">
                    <asp:TextBox runat="server" ID="txtCode" class="default" Width="150"></asp:TextBox>
                </td>
                <td nowrap="nowrap" style="text-align:right">
                    消息类型:</td>
                <td nowrap="nowrap">
                    <asp:DropDownList runat="server" ID="ddlMessageLevel" Width="150">
                    </asp:DropDownList>
                </td>
                <td nowrap="nowrap" style="text-align:right">
                    有效:
                </td>
                <td nowrap="nowrap">
                    <asp:DropDownList ID="ddlActive" runat="server" Width="150">
                        <asp:ListItem Value="">--所有--</asp:ListItem>
                        <asp:ListItem Value="1">有效</asp:ListItem>
                        <asp:ListItem Value="0">无效</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td nowrap="nowrap" style="text-align:right">
                    发布日期:</td>
                <td nowrap="nowrap">
                    <asp:TextBox runat="server" ID="txtStart" class="default" Width="150"  ></asp:TextBox>
                </td>
                <td nowrap="nowrap" style="text-align:right">
                    截止日期:
                </td>
                <td nowrap="nowrap">
                    <asp:TextBox runat="server" ID="txtEnd"   class="default"  Width="150"></asp:TextBox>
                </td>
                <td nowrap="nowrap" style="text-align:right">
                    &nbsp;</td>
                <td nowrap="nowrap">
                     
                    <asp:Button ID="btnQuery" runat="server" class="wsd_button2" Text="查  询" OnClick="btnQuery_Click" />
                    <input type="button" class="wsd_button2"  size="47" value="重  置" name="reset" onclick="clearForm('form1')" /></td>
            </tr>
            <tr >
                <td class="style1">
                    &nbsp;</td>
                <td nowrap="nowrap">
                    &nbsp;</td>
                <td class="style2">
                     
                    &nbsp;</td>
                <td  colspan="3" align="right">
                    <input id="txtHidOrg" type="hidden" runat="server" />
                    <input id="txtHidChains" type="hidden" runat="server" />
                    <input id="txtHidUsers" type="hidden" runat="server" />       
                    <asp:Label ID="Label1" runat="server" Text=" "></asp:Label>
                     
                    </td>
            </tr>
        </table><br />
        <asp:EntityDataSource ID="EntityDataSource1" runat="server">
        </asp:EntityDataSource>
        <table id="wsd_inputtable">
            <tr>
                <td class="tabletitle">
                    接收消息列表
                   
            </tr>
        </table>
         <asp:UpdatePanel UpdateMode="Conditional" ID="UpdatePanel1" runat="server">
        <ContentTemplate>
        <table id="wsd_listtable" width="100%">
            <tr>
                <td style="width: 100%">
                    <asp:GridView Width="100%" ID="gvMessage" runat="server" 
                        AutoGenerateColumns="false" BorderWidth="0" DataKeyNames="ID" 
                        EmptyDataText="没有可显示的数据." EmptyDataRowStyle-Font-Bold="true" EmptyDataRowStyle-HorizontalAlign="Center"
                        EnableEmptyContentRender="true" OnRowDataBound="Grid_RowDataBound" AllowPaging="True"
                        PageSize="10"   >
                        <HeaderStyle CssClass="titlist" />
                        <EmptyDataRowStyle HorizontalAlign="Center" Font-Bold="True"></EmptyDataRowStyle>
                        <Columns>
                            <asp:HyperLinkField DataNavigateUrlFormatString="Message_Look.aspx?MID={0}"
                           ItemStyle-Width="15%"       DataNavigateUrlFields="ID" DataTextField="TOPIC" 
                                HeaderText="主题" >
                          
<ItemStyle Width="15%" ></ItemStyle>
<ControlStyle Font-Underline="false" />
                            </asp:HyperLinkField>
                          
                    <asp:BoundField HeaderText="消息类型"   ItemStyle-Width="15%"   DataField="CONTENTLEVEL" > 
<ItemStyle Width="15%"></ItemStyle>
                            </asp:BoundField>
                            <asp:BoundField HeaderText="发布日期"   ItemStyle-Width="15%"   
                                DataField="BEGINDATE" >
<ItemStyle Width="15%"></ItemStyle>
                            </asp:BoundField>
                            <asp:BoundField HeaderText="截止日期"   ItemStyle-Width="15%"   
                                DataField="ENDDATE" >
<ItemStyle Width="15%"></ItemStyle>
                            </asp:BoundField>
                             <asp:TemplateField HeaderText="已读" ItemStyle-HorizontalAlign="center" HeaderStyle-HorizontalAlign="center">
                                    <ItemTemplate>
                                        <b>
                                            <%# (bool)Eval("READFLAG") ? "<font size='3' color='green'>√</font>" : "<font size='3' color='red'>×</font>"%></b>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="有效" ItemStyle-HorizontalAlign="center" HeaderStyle-HorizontalAlign="center">
                                    <ItemTemplate>
                                        <b>
                                            <%# (bool)Eval("ACTIVE") ? "<font size='3' color='green'>√</font>" : "<font size='3' color='red'>×</font>"%></b>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                        </Columns>
                        <PagerSettings Visible="False" />
                        <RowStyle CssClass="evenline" />
                        <AlternatingRowStyle CssClass="oddline" />
                       
                    </asp:GridView>
                    <uc1:GridPager ID="GridPager1" runat="server" Visible="false" />
                </td>
            </tr>
        </table>
        </ContentTemplate>
        <Triggers>
           
        </Triggers>
    </asp:UpdatePanel>
    </div>
</asp:Content>
